--- import BaseLayout from "../../layouts/BaseLayout.astro"; import { Header } from "../../components/layout/Header"; import { Card, CardContent, CardHeader, CardTitle } from "../../components/ui/card"; import { Badge } from "../../components/ui/badge"; import { Button } from "../../components/ui/button"; import { Globe, Star, GitFork, ExternalLink, ArrowLeft, RefreshCw, Server, Copy, BookOpen, Activity, Code2 } from "lucide-react"; import { verifyToken } from "../../lib/auth"; import { getDb } from "../../lib/db"; import { eq, desc } from "drizzle-orm"; import { instances, cachedRepos } from "../../lib/db/schema"; const token = Astro.cookies.get("community_session")?.value; const user = token ? await verifyToken(token) : null; const { id } = Astro.params; const db = getDb() as any; // Fetch Instance Details const instance = await db.query.instances.findFirst({ where: eq(instances.id, id as string) }).catch(() => null); // Fetch Repositories for this instance const repos = await db.query.cachedRepos.findMany({ where: eq(cachedRepos.instanceId, id as string), orderBy: [desc(cachedRepos.starCount), desc(cachedRepos.updatedAt)], limit: 50 }).catch(() => []); let capabilitiesList: string[] = []; try { if (instance?.capabilities) { capabilitiesList = typeof instance.capabilities === "string" ? JSON.parse(instance.capabilities) : instance.capabilities; } } catch {} ---
Back to all instances {!instance ? (

Instance Not Found

The requested node ID does not exist in the community database.

) : ( <>

{instance.name}

{instance.status || "pending"}
{instance.siteUrl}
{instance.version && ( v{instance.version} )} {capabilitiesList.map((cap: string) => ( {cap} ))} Last Synced: {instance.lastSyncAt ? new Date(instance.lastSyncAt).toLocaleString() : 'Never'}

Public Repositories ({repos.length})

{repos.length === 0 ? (

No repositories indexed yet

Click "Sync Node" above to fetch the latest public repositories from this server.

) : (
{repos.map((r: any) => (
{r.fullName}

{r.description || "No description provided."}

{r.visibility || "public"}
{r.language && {r.language}} {r.starCount || 0} {r.forkCount || 0}
))}
)}
)}